package xxy.com.yangproject.utils;

import android.util.LruCache;

public class TestLrucahe extends LruCache<String, byte[]> {

    public static TestLrucahe instance = new TestLrucahe(1024 * 1024 * 4);

    /**
     * @param maxSize for caches that do not override {@link #sizeOf}, this is
     *                the maximum number of entries in the cache. For all other caches,
     *                this is the maximum sum of the sizes of the entries in this cache.
     */
    private TestLrucahe(int maxSize) {
        super(maxSize);
    }

    public static TestLrucahe getInstance(){
        return instance;
    }

    @Override
    protected int sizeOf(String key, byte[] value) {  //super方法返回的是1
        return value.length;
    }
}
